/**
 * 
 */
package org.carabiner.infinitest;

class ResultTreeNode extends TestTreeNode
{
  public ResultTreeNode(TestEvent testEvent)
  {
    super(testEvent);
    setAllowsChildren(false);
  }
  
  public boolean isNodeForEvent(TestEvent e)
  {
    return super.isNodeForEvent(e) && 
        e.getTestMethod().equals(getTestEvent().getTestMethod());
  }
  
  public String toString()
  {
    if (getTestEvent().getError() != null)
      return getTestEvent().getTestMethod().toString() + 
             ": " +
             getTestEvent().getError().getClass().getName() + 
             "(" + 
             getTestEvent().getMessage() +
             ")";
    return getTestEvent().getTestMethod().toString() + ": " + getTestEvent().getMessage();
  }
}